import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:stock_check/common/model/inventoryTask.dart';
import 'package:stock_check/common/model/taskItem.dart';
import 'package:stock_check/common/model/checkITDeviceItem.dart';
import 'package:stock_check/common/model/taskItemDetail.dart';
import 'package:stock_check/page/AssetCheckListPage.dart';
import 'package:stock_check/page/TaskScan.dart';
import 'package:stock_check/page/assetScan.dart';
import 'package:stock_check/page/checkDevicesWorkPage.dart';
import 'package:stock_check/page/checkList.dart';
import 'package:stock_check/page/checkWork.dart';
import 'package:stock_check/page/homePage.dart';
import 'package:stock_check/page/loginPage.dart';
import 'package:stock_check/page/needCheckDeviceList.dart';

class NavigatorUtils{
  static pushReplacementNamed(BuildContext context, String routeName){
    Navigator.pushReplacementNamed(context, routeName);
  }

  static pushNamed(BuildContext context,String routeName){
    Navigator.pushNamed(context, routeName);
  }

  ///主页
  static goHome(BuildContext context) {
    Navigator.pushReplacementNamed(context, HomePage.routeName);
  }

  ///登录页
  static goLogin(BuildContext context) {
    Navigator.pushReplacementNamed(context, LoginPage.routeName);
  }

  ///盘点任务
  static goCheckWork(BuildContext context) {
    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new CheckWork()));
  }

  /// 盘点列表
  static goCheckList(BuildContext context,TaskItem item){
    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new CheckList(item:item)));
  }

  /// 资产扫描盘点
  static goTaskScanPage(BuildContext context,List<TaskDetailItem> list,int userId){
    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TaskScan(list:list,userId:userId)));
  }

  /// 巡检任务清单
  static goCheckDevicesListPage(BuildContext context,String tab){
    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new CheckDevicesWorkPage(tab: tab,)));
  }

  /// 巡检项目列表
  static goNeedCheckDeviceListPage(BuildContext context,CheckITDeviceItem item,String type){
    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new NeedCheckDeviceList(item:item,type:type)));
  }

  /// 巡检项目资产清单列表
  static goAssetCheckListPage(BuildContext context,dynamic item,int recordId,String type){
    Navigator.push(context, new MaterialPageRoute(builder: (context) => new AssetCheckListPage(item:item,type:type,recordId: recordId,)));
  }
}